package com.six.core.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName sto_goods
 */
@TableName(value ="sto_goods")
public class Goods implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 商品id
     */
    private String goodsid;

    /**
     * 商品名称
     */
    private String goodsname;

    /**
     * 进价
     */
    private Double enterprice;

    /**
     * 售价
     */
    private Double outprice;

    /**
     * 商品图片
     */
    private String img;

    /**
     * 商品描述
     */
    private String description;

    /**
     * 上下架 0 上架 1 商家下架 2管理员下架
     */
    private Integer state;

    /**
     * 逻辑删除 1（true）已删除， 0（false）未删除
     */
    private Integer isDeleted;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH-mm-ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date gmtCreate;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH-mm-ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date gmtModified;

    /**
     * 品牌id
     */
    private Integer brandid;

    /**
     * 类别id
     */
    private Integer categoryid;

    /**
     * 储存方式id
     */
    private Integer depositid;

    /**
     * 规格id
     */
    private Integer specid;

    /**
     * 商店id
     */
    private Integer shopid;

    /**
     * 库存
     */
    private Integer goodsnum;

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    public Deposit getDeposit() {
        return deposit;
    }

    public void setDeposit(Deposit deposit) {
        this.deposit = deposit;
    }

    public Shop getShop() {
        return shop;
    }

    public void setShop(Shop shop) {
        this.shop = shop;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    @TableField(exist = false)
    private String checkRenark;

    @TableField(exist = false)
    private Category category;
    @TableField(exist = false)
    private  Deposit deposit;
    @TableField(exist = false)
    private Shop shop;
    @TableField(exist = false)
    private Spec spec;
    @TableField(exist = false)
    private Emp emp;
    @TableField(exist = false)
    private Brand brand;
    @TableField(exist = false)
    private Checkgoods checkgoods;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public Checkgoods getCheckgoods() {
        return checkgoods;
    }

    public void setCheckgoods(Checkgoods checkgoods) {
        this.checkgoods = checkgoods;
    }

    public Emp getEmp() {
        return emp;
    }


    public void setEmp(Emp emp) {
        this.emp = emp;
    }

    public Brand getBrand() {
        return brand;
    }

    public void setBrand(Brand brand) {
        this.brand = brand;
    }

    public Spec getSpec() {
        return spec;
    }

    public void setSpec(Spec spec) {
        this.spec = spec;
    }

    /**
     * 
     */
    public Integer getId() {
        return id;
    }

    public String getCheckRenark() {
        return checkRenark;
    }

    public void setCheckRenark(String checkRenark) {
        this.checkRenark = checkRenark;
    }

    /**
     * 
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 商品id
     */
    public String getGoodsid() {
        return goodsid;
    }

    /**
     * 商品id
     */
    public void setGoodsid(String goodsid) {
        this.goodsid = goodsid;
    }

    /**
     * 商品名称
     */
    public String getGoodsname() {
        return goodsname;
    }

    /**
     * 商品名称
     */
    public void setGoodsname(String goodsname) {
        this.goodsname = goodsname;
    }

    /**
     * 进价
     */
    public Double getEnterprice() {
        return enterprice;
    }

    /**
     * 进价
     */
    public void setEnterprice(Double enterprice) {
        this.enterprice = enterprice;
    }

    /**
     * 售价
     */
    public Double getOutprice() {
        return outprice;
    }

    /**
     * 售价
     */
    public void setOutprice(Double outprice) {
        this.outprice = outprice;
    }

    /**
     * 商品图片
     */
    public String getImg() {
        return img;
    }

    /**
     * 商品图片
     */
    public void setImg(String img) {
        this.img = img;
    }

    /**
     * 商品描述
     */
    public String getDescription() {
        return description;
    }

    /**
     * 商品描述
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * 上下架 0 上架 1 商家下架 2管理员下架
     */
    public Integer getState() {
        return state;
    }

    /**
     * 上下架 0 上架 1 商家下架 2管理员下架
     */
    public void setState(Integer state) {
        this.state = state;
    }

    /**
     * 逻辑删除 1（true）已删除， 0（false）未删除
     */
    public Integer getIsDeleted() {
        return isDeleted;
    }

    /**
     * 逻辑删除 1（true）已删除， 0（false）未删除
     */
    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    /**
     * 创建时间
     */
    public Date getGmtCreate() {
        return gmtCreate;
    }

    /**
     * 创建时间
     */
    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    /**
     * 更新时间
     */
    public Date getGmtModified() {
        return gmtModified;
    }

    /**
     * 更新时间
     */
    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }

    /**
     * 品牌id
     */
    public Integer getBrandid() {
        return brandid;
    }

    /**
     * 品牌id
     */
    public void setBrandid(Integer brandid) {
        this.brandid = brandid;
    }

    /**
     * 类别id
     */
    public Integer getCategoryid() {
        return categoryid;
    }

    /**
     * 类别id
     */
    public void setCategoryid(Integer categoryid) {
        this.categoryid = categoryid;
    }

    /**
     * 储存方式id
     */
    public Integer getDepositid() {
        return depositid;
    }

    /**
     * 储存方式id
     */
    public void setDepositid(Integer depositid) {
        this.depositid = depositid;
    }

    /**
     * 规格id
     */
    public Integer getSpecid() {
        return specid;
    }

    /**
     * 规格id
     */
    public void setSpecid(Integer specid) {
        this.specid = specid;
    }

    /**
     * 商店id
     * @return
     */
    public Integer getShopid() {
        return shopid;
    }

    /**
     * 商店id
     */
    public void setShopid(Integer shopid) {
        this.shopid = shopid;
    }

    /**
     * 库存
     */
    public Integer getGoodsnum() {
        return goodsnum;
    }

    /**
     * 库存
     */
    public void setGoodsnum(Integer goodsnum) {
        this.goodsnum = goodsnum;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Goods other = (Goods) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getGoodsid() == null ? other.getGoodsid() == null : this.getGoodsid().equals(other.getGoodsid()))
            && (this.getGoodsname() == null ? other.getGoodsname() == null : this.getGoodsname().equals(other.getGoodsname()))
            && (this.getEnterprice() == null ? other.getEnterprice() == null : this.getEnterprice().equals(other.getEnterprice()))
            && (this.getOutprice() == null ? other.getOutprice() == null : this.getOutprice().equals(other.getOutprice()))
            && (this.getImg() == null ? other.getImg() == null : this.getImg().equals(other.getImg()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()))
            && (this.getGmtCreate() == null ? other.getGmtCreate() == null : this.getGmtCreate().equals(other.getGmtCreate()))
            && (this.getGmtModified() == null ? other.getGmtModified() == null : this.getGmtModified().equals(other.getGmtModified()))
            && (this.getBrandid() == null ? other.getBrandid() == null : this.getBrandid().equals(other.getBrandid()))
            && (this.getCategoryid() == null ? other.getCategoryid() == null : this.getCategoryid().equals(other.getCategoryid()))
            && (this.getDepositid() == null ? other.getDepositid() == null : this.getDepositid().equals(other.getDepositid()))
            && (this.getSpecid() == null ? other.getSpecid() == null : this.getSpecid().equals(other.getSpecid()))
            && (this.getShopid() == null ? other.getShopid() == null : this.getShopid().equals(other.getShopid()))
            && (this.getGoodsnum() == null ? other.getGoodsnum() == null : this.getGoodsnum().equals(other.getGoodsnum()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getGoodsid() == null) ? 0 : getGoodsid().hashCode());
        result = prime * result + ((getGoodsname() == null) ? 0 : getGoodsname().hashCode());
        result = prime * result + ((getEnterprice() == null) ? 0 : getEnterprice().hashCode());
        result = prime * result + ((getOutprice() == null) ? 0 : getOutprice().hashCode());
        result = prime * result + ((getImg() == null) ? 0 : getImg().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        result = prime * result + ((getGmtCreate() == null) ? 0 : getGmtCreate().hashCode());
        result = prime * result + ((getGmtModified() == null) ? 0 : getGmtModified().hashCode());
        result = prime * result + ((getBrandid() == null) ? 0 : getBrandid().hashCode());
        result = prime * result + ((getCategoryid() == null) ? 0 : getCategoryid().hashCode());
        result = prime * result + ((getDepositid() == null) ? 0 : getDepositid().hashCode());
        result = prime * result + ((getSpecid() == null) ? 0 : getSpecid().hashCode());
        result = prime * result + ((getShopid() == null) ? 0 : getShopid().hashCode());
        result = prime * result + ((getGoodsnum() == null) ? 0 : getGoodsnum().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", goodsid=").append(goodsid);
        sb.append(", goodsname=").append(goodsname);
        sb.append(", enterprice=").append(enterprice);
        sb.append(", outprice=").append(outprice);
        sb.append(", img=").append(img);
        sb.append(", description=").append(description);
        sb.append(", state=").append(state);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", gmtCreate=").append(gmtCreate);
        sb.append(", gmtModified=").append(gmtModified);
        sb.append(", brandid=").append(brandid);
        sb.append(", categoryid=").append(categoryid);
        sb.append(", depositid=").append(depositid);
        sb.append(", specid=").append(specid);
        sb.append(", shopid=").append(shopid);
        sb.append(", goodsnum=").append(goodsnum);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}